package com.komodo.island.gdx.screen;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.komodo.island.gdx.Art;
import com.komodo.island.gdx.GameDescription;
import com.komodo.island.gdx.Input;
import com.komodo.island.gdx.KomodoIsland;
import com.komodo.island.gdx.Persistence;
import com.komodo.island.gdx.dialog.MapScientistDialog;

public class MapScientistScreen extends MapScreen {

	public MapScientistScreen() {
		// TODO Auto-generated constructor stub
		ID = Input.SCREEN_SCIENTIST;
	}
	
	@Override
	public void init(KomodoIsland komodoIsland, Texture texture) {
		// TODO Auto-generated method stub
		super.init(komodoIsland,  texture);
		
		gameDescDialog = new GameDescription(480, 320, true, this,komodoIsland.factTexture,new TextureRegion(texture, 480*2, 320, 480, 320),komodoIsland);
//		gameDescDialog.init();
		this.mapDialog = new MapScientistDialog(480, 320, true, this, texture,komodoIsland);
		
		
		
	}
	
	@Override
	public void onScreenRun() {
		// TODO Auto-generated method stub
		super.onScreenRun();
		
	}

	@Override
	public void onScreenLoading() {
		// TODO Auto-generated method stub
		
	}
	
	@Override
	public void show() {
		// TODO Auto-generated method stub
		super.show();
		if (Persistence.sound) {
			if (komodoIsland.main.isPlaying()){
				komodoIsland.main.stop();
			}else{
				
			}
			if (komodoIsland.scientist.isPlaying()){
				
			}else{
				komodoIsland.scientist.play();
			}
			
		} else {
			komodoIsland.main.stop();
			if (komodoIsland.scientist.isPlaying())
				komodoIsland.scientist.stop();

		}
	}
	
	@Override
	public void hide() {
		// TODO Auto-generated method stub
		super.hide();
		try{
			if (Persistence.sound){
				if (komodoIsland.scientist.isPlaying()){
					komodoIsland.scientist.stop();
				}
			}else{
				
			}
		}catch(Exception e){
			
		}
	}

}
